﻿using HamcoWcs.Models.DeviceMsgs.BconMsgs;
using HamcoWcs.Models.PlcInfos;
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;

namespace HamcoWcs.Models.Devices
{
    public class BconPlc
    {
        public Socket SocketClient { get; set; }
        public bool ConnectionStatus { get; set; }
        public string PlcName { get; }
        public IPEndPoint Ipe { get; set; }
        public PlcInfoDto PconPlcInfo { get; set; } = new PlcInfoDto();
        //待发送整包列表，发送后删除。
        public List<BconMsg> SendingMsgsBuffer { get; set; } = new List<BconMsg>();
        //带发送Tel列表，代入SendingMsgs后删除。
        public List<BconBaseTel> SendingTelsBuffer { get; set; } = new List<BconBaseTel>();
        //已发送列表，收到ack后删除。
        public Dictionary<string, BconMsg> SendedMsgsBuffer { get; set; } = new Dictionary<string, BconMsg>();
        public DateTime LastMsgTime { get; set; } = DateTime.Now;
        public string HalfMsg { get; set; }
        public int MsgNum { get; set; }
        public BconPlc(string plcName)
        {
            PlcName = plcName;
        }
    }
}